'use strict';

module.exports = function collectSameElements(collectionA, collectionB) {
   let result=new Array();
   for(let i=0;i<collectionA.length;i++){
     for(let n=0;n<collectionB.length;n++){
       if(collectionA[i]==collectionB[n]){
         result.push(collectionA[i]);
       }
     }
  } 
   return result;
  //let result = collectionA.filter((item)=>(collectionB.includes(item)))
  //return result;
}
